package vo;

import javax.persistence.*;

@Entity
@NamedQueries({ 
	@NamedQuery(name = "Favorite.findAll", query = "select e from Favorite e"), 
	@NamedQuery(name = "Favorite.findByUserId", query = "select e from Favorite e where e.user.id=?"),
	@NamedQuery(name = "Favorite.findByUserIdItemId", query = "select e from Favorite e where e.user.id=? and e.itemId=?"),
	@NamedQuery(name = "Favorite.findTotalCount", query = "select count(*) from Favorite t") })
@Table(name = "favorite")
public class Favorite extends BaseEntity {

	@Column(name = "item_id")
	private String itemId;

	@JoinColumn(name = "user_id")
	@ManyToOne(fetch = FetchType.LAZY)
	private User user;

	public String getItemId() {
		return itemId;
	}

	public void setItemId(String itemId) {
		this.itemId = itemId;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}
